package com.teamclub.app.scontrollers.systemmanager

import com.teamclub.app.sforms.AppDomainForm
import com.teamclub.app.sservices.systemmanager.AppDomainService
import com.teamclub.util.libs.Eithers
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.{PostMapping, RequestBody, RequestMapping, RestController}

/**
  * Created by ilkkzm on 17-8-7.
  */

@RestController("com.teamclub.app.scontrollers.systemmanager.AppDomainController")
@RequestMapping(Array("/app/systemmanager"))
class AppDomainController {
  @Autowired
  var appDomainService: AppDomainService = _

  @PostMapping(Array("applist"))
  def list(@RequestBody form: AppDomainForm) = {
    Eithers.toJson(appDomainService.list(form))
  }
  @PostMapping(Array("appadd"))
  def add(@RequestBody form: AppDomainForm) = {
    Eithers.toJson(appDomainService.add(form))
  }
  @PostMapping(Array("appdel"))
  def del(@RequestBody form: AppDomainForm) = {
    Eithers.toJson(appDomainService.del(form))
  }
}
